﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/MedicalDirector/MasterDirect.master" AutoEventWireup="true" CodeFile="Danhsachyeucau.aspx.cs" Inherits="Management_MedicalDirector_Danhsachyeucau" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%; height: 383px;">
        <tr>
            <td style="width: 455px">
                <table style="width:100%;">
                    <tr>
                        <td style="width: 60px">&nbsp;</td>
                        <td style="width: 100px">
                            <asp:Label ID="Label1" runat="server" Text="Loại Danh sách"></asp:Label>
                        </td>
                        <td style="width: 187px">
                            <asp:DropDownList ID="dlSelect" runat="server" Width="180px" OnSelectedIndexChanged="dlSelect_SelectedIndexChanged" AutoPostBack="true" EnableViewState="true">
                                <asp:ListItem Value="0">Yêu cầu thuốc</asp:ListItem>
                                <asp:ListItem Value="3">Chờ nhận</asp:ListItem>
                            </asp:DropDownList>
                        <%--</td>--%>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
            <td style="text-align:center">
                <asp:Label ID="lbTitle" runat="server"  Font-Bold="true" Font-Size="Larger" ForeColor="Green"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 455px; height: 374px;">
                <asp:Panel ID="pnTable" runat="server" Height="250px" Width="448px" >
                    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="yeucau"  Width="446px" CellPadding="4" ForeColor="#333333" GridLines="None" BorderWidth="1px" BorderColor="Blue" AllowSorting="True">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="Người yêu cầu" SortExpression="FirstName">                                
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("FirstName")+" " + Eval("LastName") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle Height="25px" />
                                <ItemStyle Height="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="RequisitionDate" HeaderText="Ngày Yêu Cầu" SortExpression="RequisitionDate">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="20px" />
                            </asp:BoundField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btView" runat="server" CausesValidation="false" CommandName="" Text="Xem" OnClick="view_click" CommandArgument='<%# Eval("ID") %>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <sortedascendingcellstyle backcolor="#F5F7FB" />
                        <sortedascendingheaderstyle backcolor="#6D95E1" />
                        <sorteddescendingcellstyle backcolor="#E9EBEF" />
                        <sorteddescendingheaderstyle backcolor="#4870BE" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="yeucau" runat="server" ConnectionString="<%$ ConnectionStrings:HOSPITALMANAGEMENTConnectionString %>" SelectCommand="SELECT tbRequisition.ID, tbStaff.FirstName, tbStaff.LastName, tbRequisition.RequisitionDate, tbRequisition.Accepted FROM tbRequisition INNER JOIN tbStaff ON tbRequisition.IDStaff = tbStaff.ID WHERE (tbRequisition.Accepted = @Accepted) ORDER BY tbRequisition.DateReceive" >
                        <SelectParameters>
                            <asp:ControlParameter ControlID="dlSelect" DefaultValue="0" Name="Accepted" PropertyName="SelectedValue" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </asp:Panel>
            </td>
            <td style="vertical-align:top; height: 374px;">
                <asp:Panel ID="pnDetails" runat="server" Height="345px" Visible="false" BackColor="#FFFFEA" Width="480px">
                    <table style="border-style: solid; border-color: inherit; border-width: medium; width:100%; height: 344px;" border="1">
                        <tr>
                            <td style="height: 20%; text-align:center">
                                <asp:Label ID="Label2" runat="server" Font-Size="X-Large" Text="Wellmeadows Hospital Central Store Requisition Form" Font-Bold="true" ForeColor="Blue"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="height: 20%; vertical-align:top">
                                <table style="width:100%;">
                                    <tr style="text-align:center;top:5px">
                                        <td colspan="4" style="height: 23px">
                                            <asp:Label ID="Label4" runat="server" Text="Mã số yêu cầu:" Font-Size="Medium" ForeColor="Green" Font-Bold="true"></asp:Label>
                                            <asp:Label ID="lbRequisition" runat="server" Text="" Font-Size="Medium" ForeColor="Red" Font-Italic="true" Font-Underline="true"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 25%; white-space:nowrap" >
                                            <asp:Label ID="Label5" runat="server" Text="Mã Khoa:"></asp:Label>
                                        </td >
                                        <td style="width: 25%; white-space:nowrap">
                                            <asp:Label ID="lbNumber" runat="server" Text="" Font-Underline="true"></asp:Label>
                                        </td>
                                        <td style="width: 25%; white-space:nowrap"s>
                                            <asp:Label ID="Label6" runat="server" Text="Người yêu cầu:"></asp:Label>
                                        </td>
                                        <td style="width: 25%; white-space:nowrap">
                                            <asp:Label ID="lbReTo" runat="server" Text="" Font-Underline="true"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td td style="width: 25%; white-space:nowrap">
                                            <asp:Label ID="Label7" runat="server" Text="Tên Khoa:"></asp:Label>
                                        </td>
                                        <td td style="width: 25%; white-space:nowrap">
                                            <asp:Label ID="lbName" runat="server" Text="" Font-Underline="true"></asp:Label>
                                        </td>
                                        <td td style="width: 25%; white-space:nowrap">
                                            <asp:Label ID="Label8" runat="server" Text="Ngày yêu cầu:"></asp:Label>
                                        </td>
                                        <td td style="width: 25%; white-space:nowrap"><asp:Label ID="lbReDate" runat="server" Text="" Font-Underline="true"></asp:Label></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 60%;vertical-align:top" class="contentLeft2">
                                <asp:GridView ID="GridView3" runat="server" DataSourceID="detail" CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" Width="478px" BorderWidth="1px" BorderColor="Black">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:BoundField DataField="ID" HeaderText="STT" InsertVisible="False" ReadOnly="True" SortExpression="ID">
                                            <HeaderStyle ForeColor="White" Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Name" HeaderText="Tên" SortExpression="Name">
                                            <HeaderStyle ForeColor="#66CCFF" Width="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Desc" HeaderText="Mô tả" SortExpression="Desc">
                                            <HeaderStyle ForeColor="White" Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="UnitType" HeaderText="Đơn vị" SortExpression="UnitType">
                                            <HeaderStyle ForeColor="#66CCFF" Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="UseMethod" HeaderText="Sử dụng" SortExpression="UseMethod">
                                            <HeaderStyle ForeColor="White" Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="CostPerUnit" HeaderText="Giá tiền" SortExpression="CostPerUnit">
                                            <HeaderStyle ForeColor="#66CCFF" Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Quantity" HeaderText="Số lượng" SortExpression="Quantity">
                                            <HeaderStyle ForeColor="White" Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>
                                    </Columns>
                                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                                    <SelectedRowStyle BackColor="#FFCC66" ForeColor="Navy" Font-Bold="True" />
                                    <sortedascendingcellstyle backcolor="#FDF5AC" />
                                    <sortedascendingheaderstyle backcolor="#4D0000" />
                                    <sorteddescendingcellstyle backcolor="#FCF6C0" />
                                    <sorteddescendingheaderstyle backcolor="#820000" />
                                </asp:GridView>
                                <asp:SqlDataSource ID="detail" runat="server" ConnectionString="<%$ ConnectionStrings:HOSPITALMANAGEMENTConnectionString %>" SelectCommand="SELECT tbDrug.ID, tbDrug.Name, tbDrug.[Desc], tbDrug.UnitType, tbDrug.UseMethod, tbDrug.CostPerUnit, tbRequisitionDetail.Quantity FROM tbDrug INNER JOIN tbRequisitionDetail ON tbDrug.ID = tbRequisitionDetail.IDDrug WHERE (tbRequisitionDetail.IDRequisition = @id)">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="lbRequisition" DefaultValue="0" Name="id" PropertyName="Text" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <table style="width:100%;">
                                    <tr>
                                        <td style="width: 165px">&nbsp;</td>
                                        <td style="width: 102px">
                                            <asp:Button ID="btAccept" runat="server" Text="Chấp Nhận" Width="88px" OnClick="accept_click"/>
                                        </td>
                                        <td>
                                            <asp:Button ID="btCancel" runat="server" Text="Hủy Bỏ" OnClick="cancel_click" />
                                        </td>
                                    </tr>
                                </table>
                            </td
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>

